package com.ruoyi.fetvApi.controller;

import java.util.List;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.fetvApi.domain.FetvColumnApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.fetvApi.service.IFetvColumnApiService;

/**
 * 栏目Controller
 *
 * @author lwj
 * @date 2023-02-27
 */
@RestController
@RequestMapping("index/fetv/column")
@CrossOrigin
public class FetvColumnApiController extends BaseController
{
    @Autowired
    private IFetvColumnApiService fetvColumnService;

    /**
     * 查询栏目列表
     */
    @Anonymous
    @GetMapping("/list")
    public TableDataInfo list(FetvColumnApi fetvColumnApi)
    {
        startPage();
        List<FetvColumnApi> list = fetvColumnService.selectFetvColumnList(fetvColumnApi);
        return getDataTable(list);
    }

    /**
     * 根据栏目id，展示新闻信息
     */
    @Anonymous
    @GetMapping
    public TableDataInfo getInformationByColumnId(@RequestParam Integer columnId)
    {
        List<FetvColumnApi> list = fetvColumnService.getInformationByColumnId(columnId);
        return getDataTable(list);
    }
    /**
     * 微视频
     */
    @Anonymous
    @GetMapping(value = "/getVideoBySix")
    public TableDataInfo getVideoByColumnId(@RequestParam Integer columnId)
    {

        List<FetvColumnApi> list = fetvColumnService.getVideoByColumnId(columnId);
        return getDataTable(list);
    }


    /**
     * 返回首页数组新闻
     * @return
     */
    @Anonymous
    @GetMapping(value = "/getColumnByList")
    public TableDataInfo getInformationListByColumn()
    {
        List<FetvColumnApi> list = fetvColumnService.getInformationListByColumn();
        return getDataTable(list);

    }

    /**
     * 返回七条音频新闻(空中课堂)
     * @param columnId
     * @return
     */
    @Anonymous
    @GetMapping(value = "/getSevenVideoByColumn")
    public TableDataInfo getAirClassroomByColumnId(@RequestParam Integer columnId)
    {
        List<FetvColumnApi> list = fetvColumnService.getAirClassroomByColumnId(columnId);
        return getDataTable(list);

    }




}
